//调用fn,得到内部的data
function fn (callback) {
  setTimeout(function(){
    var data = '异步任务的结果'
    callback(data)
  }, 3000)
}

fn (function callback(data){
  console.log(data) // 三秒钟后，这个 callback 函数会被执行
})


//for in 遍历拷贝对象
var obj = {
  name: 'tom',
  age: 18,
  gender: 'male'
}

var obj1 = {
  name: 'jack',
  age: 20,
  gender: 'female'
}

for (var key in obj) {
  obj[key] = obj1[key]
}
console.log(obj)